package com.getpebble.android.framework.protocol.inbound;

import com.getpebble.android.bluetooth.protocol.ProtocolMessage;
import com.getpebble.android.common.model.AppVersion;
import com.getpebble.android.framework.protocol.inbound.PblInboundAppInstallMessage.AppInstallResponseType;
import com.getpebble.android.framework.util.ByteUtils;
import java.nio.ByteBuffer;

public class PblInboundAppInfoInstallMessage extends PblInboundAppInstallMessage {
    private String mAppName;
    private String mCompanyName;
    private AppVersion mVersion;

    protected PblInboundAppInfoInstallMessage(ProtocolMessage message) {
        super(message);
        ByteBuffer buffer = message.getDataBuffer();
        checkResponseType(buffer.get());
        this.mVersion = new AppVersion(ByteUtils.getUint8FromBuffer(buffer).intValue(), ByteUtils.getUint8FromBuffer(buffer).intValue());
        this.mAppName = ByteUtils.getStringFromBuffer(buffer, 32);
        this.mCompanyName = ByteUtils.getStringFromBuffer(buffer, 32);
    }

    public AppVersion getVersion() {
        return this.mVersion;
    }

    public String getAppName() {
        return this.mAppName;
    }

    public String getCompanyName() {
        return this.mCompanyName;
    }

    public AppInstallResponseType getResponseType() {
        return AppInstallResponseType.APP_INFO;
    }

    protected int getMinSize() {
        return 11;
    }
}
